% by YLX on 6/10
% Version 2.3
% Update log 
%% changed the sequence of global variables
%% changed function name removeRepeated -> prunePIE

function PIE = findPIE(m, s_row)
    global J % 全局变量 全局使用
    global PIE
    global seq index  % used in expandFor
    PIE = zeros(1, J);
    index = 1;
    seq = zeros(1, J-1);

    expandFor(m, J-1) % raw PIE was filled here
    PIE = prunePIE(PIE, s_row); 
    % 删除不符合规则的pie
    % 与 SBY 的 realPIE类似
    return;